package org.giovanolli.mumi.util;

import java.text.DateFormatSymbols;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

import org.apache.commons.lang.StringUtils;

public class DayNameConstants {

	public static final List<WeekDayName> ENGLISH_DAY_NAMES = getDayNames(Locale.ENGLISH);

	public static final List<WeekDayName> SPANISH_DAY_NAMES = getDayNames(new Locale("es"));

	public static List<WeekDayName> getDayNames(Locale locale) {
		List<WeekDayName> dayNames = new ArrayList<WeekDayName>();
		DateFormatSymbols symbols = new DateFormatSymbols(locale);
		String[] dayNamesStrings = symbols.getWeekdays();
		int order = 1;
		for (String s : dayNamesStrings) {
			if (!StringUtils.isEmpty(s)) {
				dayNames.add(new WeekDayName(s, order));
				order++;
			}
		}
		return dayNames;
	}

	public static List<WeekDayName> getDefaultDayNames() {
		return getDayNames(Locale.ENGLISH);
	}

	private DayNameConstants() {
	}

}
